package main

import "fmt"

type Student struct {
	Id    int
	Name  string
	Phone string
}

func main() {
	student := Student{1, "mingquan", "15252345524"}
	fmt.Println(student)
	student.setName("nanfeng")
	student.getName()
	fmt.Println(student)
}

//使用*进行引用传递，不使用*只是拷贝
func (s *Student) show() {
	fmt.Println("student id : ", s.Id)
	fmt.Println("student name : ", s.Name)
	fmt.Println("student phone : ", s.Phone)

}

func (s *Student) getName() string {
	return s.Name
}

func (s *Student) setName(params string) {
	s.Name = params
}
